package com.gonsin.i18n.logic.machine.baidu;

import com.gonsin.i18n.logic.machine.ITranslate;

/**
 * 用百度翻译引擎实现百度翻译
 */
public class BaiduTranslate implements ITranslate {


    private TransApi api;

    private String appId;

    private String securityKey;

    public BaiduTranslate(String appId, String securityKey) {
        this.appId = appId;
        this.securityKey = securityKey;
        this.api = new TransApi(appId, securityKey);
    }

    @Override
    public String translate(String origin, String project, String lang) {
        return api.getTransResult(origin, "zh", lang);
    }
}
